#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; ++i)
const int N = 110;
int n;
int a[N];
int cnt[N];
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    memset(cnt, 0, sizeof cnt);
    cin >> n;
    rep(i, 0, n) cin >> a[i];
    rep(i, 0, n) cnt[a[i]]++;
    int b = 0, c = 0;
    int i = 0;
    while (i < n && cnt[i] >= 2) {
      b++, c++, i++;
    }
    while (i < n && cnt[i] >= 1) {
      b++, i++;
    }
    cout << b + c << endl;
  }
}
